package com.example.administrator.androidlibrary.utils;

import android.transition.Explode;
import android.transition.Fade;
import android.transition.Slide;

/**
 * Created by Administrator on 2018/4/4 0004.
 */

public class ActivityAnimateUtil {
    private static volatile Fade fade;
    private static volatile Explode explode;
    private static volatile Slide slide;
    public static Slide getSlidAnimate(int slideEdge){
        if(slide==null){
            synchronized (ActivityAnimateUtil.class){
                if(slide==null){
                    slide=new Slide();
                    slide.setDuration(500);
                }
            }
        }
        slide.setSlideEdge(slideEdge);
        return slide;
    }
    public static Fade getFadeAnimate(){
        if(fade==null){
            synchronized (ActivityAnimateUtil.class){
                if(fade==null){
                    fade=new Fade();
                    fade.setDuration(500);
                }
            }
        }
        return fade;
    }
    public static Explode getExplodeAnimate(){
        if(explode==null){
            synchronized (ActivityAnimateUtil.class){
                if(explode==null){
                    explode=new Explode();
                    explode.setDuration(500);
                }
            }
        }
        return explode;
    }
}
